package com.crois.barrier.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crois.barrier.admin.entity.ApiFailCodeInfo;
import com.crois.barrier.admin.mapper.ApiFailCodeInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * barrier 错误响应码信息
 * @author Hou Ze Yu
 * @date 2021-10-25 11:58:20
 */
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiFailCodeInfoSvc extends ServiceImpl<ApiFailCodeInfoMapper,ApiFailCodeInfo> implements IApiFailCodeInfoSvc {

    @Override
    public List<ApiFailCodeInfo> findApiFailCodeInfoListByApiResponseInfoId(Integer apiResponseInfoId) {
        QueryWrapper<ApiFailCodeInfo> apiFailCodeInfoQueryWrapper = new QueryWrapper<>();
        apiFailCodeInfoQueryWrapper.lambda().eq(ApiFailCodeInfo::getApiResponseId,apiResponseInfoId);
        return baseMapper.selectList(apiFailCodeInfoQueryWrapper);
    }
}
